package com.wwl.thread.sync;

public class Account {
    private int balance=0;

    public int getBalance() {
        return balance;
    }
    //存钱
    public void deposit(int amount){
        int newBalance = this.balance + amount;
        try {
            Thread.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.balance = newBalance;
    }
}
